﻿using System;
using System.Web;
using Core.AdminUser;
using Core.Authenticated;

namespace CMS.Controls
{
    public partial class TopNav : AuthenticatedControl
    {
        protected void lbClearCache_Click(object sender, EventArgs e)
        {
            var enumerator = HttpContext.Current.Cache.GetEnumerator();
            while (enumerator.MoveNext())
                HttpContext.Current.Cache.Remove(enumerator.Key.ToString());
            Response.Redirect(Request.RawUrl);
        }

        protected void lbRefresh_Click(object sender, EventArgs e)
        {
            Response.Redirect(Request.RawUrl);
        }

        protected void lbLogout_Click(object sender, EventArgs e)
        {
            AdminUserController.Logout();
            Response.Redirect(Request.RawUrl);
        }
    }
}